package mysql.types;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by thormentor on 27-04-2014.
 */
public class Types {
    static final List<Type> TYPES = new ArrayList<>();

    public static final Int INT = new Int();
    public static final Varchar VARCHAR = new Varchar();
    public static final Timestamp TIMESTAMP = new Timestamp();
    public static final Bit BIT = new Bit();
    public static final Text TEXT = new Text();

    public static Type valueOf(String temp) {
        for(Type type : TYPES)
            if (type.match(temp))
                return type;

        throw new RuntimeException(temp);
    }
}
